<template>
  <div class="practice-record">
    <div v-for="(item, index) in unref(data.tabData)" :key="index" class="item">
      <div class="label" v-html="item.title"></div>
      <div class="time">{{ formatTime(item.create_time) }}</div>
    </div>
  </div>
</template>
<script setup>
import { unref } from 'vue';
import dayjs from 'dayjs';
const data = defineProps({
  tabData: {
    type: Array,
    default: () => []
  },
});
const formatTime = (time) => {
  return dayjs(time * 1000).format('YYYY-MM-DD HH:mm');
}
</script>

<style lang="scss" scoped>
.practice-record {
  margin: 15px 12px 0 12px;
  .item {
    margin-bottom: 15px;
    .label {
      font-size: var(--default12px);
      color: var(--otherFontColor);
    }
    .time {
      color: var(--timeFontColor);
      font-size: var(--default12px);
      margin-top: 10px;
    }
  }
}
</style>
